type RoleKey = "chef" | "diner" | "guest";

function safeSetTabBarItem(options: WechatMiniprogram.SetTabBarItemOption) {
  try {
    wx.setTabBarItem(options);
  } catch (error) {
    console.warn("setTabBarItem failed", error);
  }
}

export function applyTabBar(role: RoleKey) {
  safeSetTabBarItem({ index: 0, text: "菜单" });
  safeSetTabBarItem({ index: 1, text: "订单" });
  safeSetTabBarItem({ index: 2, text: "我的" });
}
